package com.gopay.common.constants.bank;

public enum IPayOrderStatus {
	QUERY_IPAY_STATE_SUCC("00","交易成功"),
	QUERY_IPAY_STATE_FAIL("04","交易失败"),
	QUERY_IPAY_STATE_01("01","商户不存在"),
	QUERY_IPAY_STATE_02("02","不允许重复提交订单"),
	QUERY_IPAY_STATE_03("03","当前没有渠道可以允许交易"),
	QUERY_IPAY_STATE_05("05","查询订单不存在"),
	QUERY_IPAY_STATE_06("06","原支付订单不存在"),
	QUERY_IPAY_STATE_07("07","退款金额大于可退金额"),
	QUERY_IPAY_STATE_08("08","对账文件不存在，请等待生成"),
	QUERY_IPAY_STATE_09("09","原支付订单未成功，无法退款"),
	QUERY_IPAY_STATE_10("10","请确认上一笔退款状态"),
	QUERY_IPAY_STATE_11("11","IP受限"),
	QUERY_IPAY_STATE_12("12","订单超过有效时间，失效"),
	QUERY_IPAY_STATE_13("13","退款金额大于可清算的支付金额，不允许退款"),
	QUERY_IPAY_STATE_14("14","暂不支持部分退款"),
	QUERY_IPAY_STATE_15("15","支付方式[pay_type]传值错误"),
	QUERY_IPAY_STATE_16("16","不支持当日退款"),
	QUERY_IPAY_STATE_17("17","银行编码错误"),
	QUERY_IPAY_STATE_90("90","补单为成功"),
	QUERY_IPAY_STATE_96("96","验证签名失败"),
	QUERY_IPAY_STATE_97("97","其他错误"),
	QUERY_IPAY_STATE_98("98","交易超时"),
	QUERY_IPAY_STATE_99("99","处理中");
    
	private String key;
    public String value;

    IPayOrderStatus(String key, String value) {
        this.key = key;
        this.value = value;
    }

    // 普通方法
    public static String getName(String key) {
        for (IPayOrderStatus info : IPayOrderStatus.values()) {
            if (info.getKey().equals(key)) {
                return info.value;
            }
        }
        return "";
    }

    @Override
    public String toString() {
        return this.value;
    }

    /**
     * @return the key
     */
    public String getKey() {
        return key;
    }

    /**
     * @param key the key to set
     */
    public void setKey(String key) {
        this.key = key;
    }

    /**
     * @return the value
     */
    public String getValue() {
        return value;
    }

    /**
     * @param value the value to set
     */
    public void setValue(String value) {
        this.value = value;
    }
}
